<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="DC.Type" content="reference">
<meta name="DC.Title" content="critical_section">
<meta name="DC.subject" content="critical_section">
<meta name="keywords" content="critical_section">
<meta name="DC.Relation" scheme="URI" content="../../../reference/synchronization/ppl_compatibility_synch.htm">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="critical_section">
<meta name="DC.Language" content="en-US">
<link rel="stylesheet" type="text/css" href="../../../intel_css_styles.css">
<title>critical_section</title>
</head>
<body id="critical_section">
 <!-- ==============(Start:NavScript)================= -->
 <script src="..\..\..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
 <script language="JavaScript1.2" type="text/javascript">WriteNavLink(3);</script>
 <!-- ==============(End:NavScript)================= -->
<a name="critical_section"><!-- --></a>


    <h1 class="topictitle1">critical_section</h1>

    
<div><div class="section"><h2 class="sectiontitle">Summary</h2>
        <p>A PPL-compatible mutex.</p>

        </div>
<div class="section"><h2 class="sectiontitle">Syntax</h2>
        <pre>class critical_section;</pre>
        </div>
<div class="section"><h2 class="sectiontitle">Header</h2>
        <pre>#include "tbb/critical_section.h"</pre>
        </div>
<div class="section"><h2 class="sectiontitle">Description</h2>
        <p>A critical_section implements a PPL <samp class="codeph">critical_section</samp>. Its functionality is a subset of the functionality of a <samp class="codeph">tbb::mutex</samp>.</p>

        </div>
<div class="section"><h2 class="sectiontitle">Members</h2>
<pre>namespace tbb {
    &nbsp;&nbsp;&nbsp; class critical_section {
    &nbsp;&nbsp;&nbsp; public:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; critical_section();
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~critical_section();
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void lock();
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool try_lock();
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void unlock();
    &nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class scoped_lock {
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scoped_lock( critical_section&amp; mutex );
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~scoped_lock();
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };
    &nbsp;&nbsp; };
    }</pre></div>

 
    </div>
 
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../../../reference/synchronization/ppl_compatibility_synch.htm">PPL Compatibility</a></div>
</div>
<div></div>

</body>
</html>
